﻿@using ForzaGT3.Areas.Admin.Models
@model GalleryModel
@{
    ViewBag.Title = "Edit";
}
<div class="well">
    @using (Html.BeginForm(MVC.Admin.Gallery.Edit(), FormMethod.Post, new { @class = "form-horizontal", @enctype = "multipart/form-data" }))
    {
        <fieldset>
            <div id="legend" class="">
                <legend class="">Edit Gallery</legend>
            </div>
            @Html.HiddenFor(m=>m.Id)
            <div class="control-group">
                <!-- Text input-->
                <label class="control-label" for="input01">
                    Title</label>
                <div class="controls">
                    @Html.TextBoxFor(x => x.Title, new { @placeholder = "Title", @class = "input-xlarge" })
                    <p class="help-block">@Html.ValidationMessageFor(m => m.Title)</p>
                </div>
            </div>
           
            <div class="control-group">
                <!-- Textarea -->
                <label class="control-label">
                    Caption</label>
                <div class="controls">
                    <div class="textarea">
                        @Html.TextAreaFor(m => m.Caption)
                    </div>
                </div>
            </div>
           
            <div class="control-group">
                <label class="control-label">
                    Image</label>
                <!-- File Upload -->
                <div class="controls">
                    <img src="@Url.Content("~" + Model.Url)" alt="@Model.Title" />
                    @Html.TextBoxFor(m => m.Image, new { @type = "file", @class = "input-file" })
                </div>
            </div>

            <div class="control-group">
                <label class="control-label">
                    Thumb Image</label>
                <!-- File Upload -->
                <div class="controls">
                    <img src="@Url.Content("~" + Model.ThumbUrl)" alt="@Model.Title" />
                    @Html.TextBoxFor(m => m.ThumbImage, new { @type = "file", @class = "input-file" })
                </div>
            </div>
            
            <div class="control-group">
                <!-- Form Actions -->
                <div class="form-actions">
                    <button type="submit" class="btn btn-primary">
                        Save changes</button>
                    <button type="button" onclick="javascript:location.href='/Admin/Gallery';" class="btn">
                        Cancel</button>
                </div>
            </div>
        </fieldset>
    }
</div>